package com.sfac.javaSpringBoot.modules.common.entity;

public class Result<T>{
    private int status;
    private  String message;
    private T date;            //传啥类型返回啥类型


    //增加有参构造器
    public Result() {            //无参构造
    }

    public Result(int status, String message) {         //返回两个值
        this.status = status;
        this.message = message;
    }

    public Result(int status, String message, T date) {
        this.status = status;
        this.message = message;
        this.date = date;
    }


    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getDate() {
        return date;
    }

    public void setDate(T date) {
        this.date = date;
    }


    //状态码  用枚举表示状态
    public enum ResultCode{
        SUCCESS(200),
        FAILED(500);

        public int code;

        ResultCode(int code){
            this.code = code;
        }
    }

}
